package com.iplay.实战java高并发程序设计.chapter2;

/**
 * @author dangwu
 * @since 2021/4/29 5:31 下午
 */
public class JoinMain {
    public volatile static int i = 0;
    public static class AddThread extends Thread{
        @Override
        public void run() {
            for (i = 0;i < 1000;i++){
                System.out.println("===="+i);
            };
        }
    }

    public static void main(String[] args) throws InterruptedException {
        AddThread at = new AddThread();
        at.start();
        at.join();
        System.out.println("最后打印 "+i);
    }
}
